<!DOCTYPE html>
<html>
<head>
    <title>API测试</title>
    <meta charset="utf-8">
</head>
<body>
    <h1>API连接测试</h1>
    <button onclick="testAPI()">测试发送验证码接口</button>
    <div id="result"></div>

    <script>
        async function testAPI() {
            const resultDiv = document.getElementById('result');
            resultDiv.innerHTML = '测试中...';
            
            try {
                const response = await fetch('http://localhost:8080/agg/sms/send?phone=13800138000', {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                });
                
                const data = await response.text();
                resultDiv.innerHTML = `
                    <h3>响应状态: ${response.status}</h3>
                    <h3>响应内容:</h3>
                    <pre>${data}</pre>
                `;
            } catch (error) {
                resultDiv.innerHTML = `
                    <h3 style="color: red;">请求失败:</h3>
                    <pre>${error.message}</pre>
                `;
            }
        }
    </script>
</body>
</html>
